************** 	REPLICATION FILES FOR FENZL, MICHELE. "A SHADOW ON DEMOCRACY?"
**************  THE SHADOW ECONOMY AND GOVERNMENT RESPONSIVENESS. EUROPEAN JOURNAL
**************  OF POLITICAL RESEARCH.

**************  Contact info of author: michele.fenzl@maastrichtuniversity.nl

**************  The analyses were originally produced using Stata 14. 
**************  To reproduce Figure 1 you need to install the package grinter:
**************  To do so use the command findit grinter 
**************  Then, select grinter from https://myweb.uiowa.edu/fboehmke/stata (V1.08)

use "FenzlM_Democracy_in_shadow_EJPR.dta", clear

**** table 1 
xtpcse d.totgen d.shec_se if sample_main == 1
xtpcse d.totgen d.shec_se d.real d.wdi_trade d.empra d.ictd_taxind if sample_main == 1
xtpcse d.corpo d.shec_se if sample_main == 1
xtpcse d.corpo d.shec_se d.real d.wdi_trade d.empra d.ictd_taxind if sample_main == 1


**** table 2
gen dtotgen = d.totgen
gen ltotgen = l.totgen
gen dcmedianaug = d.cmedianaug
gen lcmedianaug = l.cmedianaug
gen dshec_se = d.shec_se
gen lshec_se = l.shec_se
gen Dint_cmedianaugXshec_se = d.cmedianaug * d.shec_se
gen Lint_cmedianaugXshec_se = l.cmedianaug * l.shec_se
gen dreal = d.real
gen lreal = l.real
gen dvdem_corr = d.vdem_corr
gen lvdem_corr = l.vdem_corr
gen dopenc = d.openc
gen lopenc = l.openc
gen dunemp = d.unemp
gen lunemp = l.unemp
gen dwdi_trade = d.wdi_trade
gen lwdi_trade = l.wdi_trade
gen dempra = d.empra
gen lempra = l.empra
gen dictd_taxind = d.ictd_taxind
gen lictd_taxind = l.ictd_taxind

drop cc
encode cname, gen(cc)

set more off
xtpcse dtotgen ltotgen dcmedianaug lcmedianaug dshec_se lshec_se i.cc if sample_main == 1
xtpcse dtotgen ltotgen dshec_se dcmedianaug Dint_cmedianaugXshec_se lcmedianaug lshec_se Lint_cmedianaugXshec_se i.cc if sample_main == 1
xtpcse dtotgen ltotgen dshec_se dcmedianaug Dint_cmedianaugXshec_se lcmedianaug lshec_se Lint_cmedianaugXshec_se dreal lreal dvdem_corr lvdem_corr dwdi_trade lwdi_trade dempra lempra dictd_taxind lictd_taxind i.cc if sample_main == 1


**** figure 1
lab var dcmedianaug "{it:{&delta}}Median voter{subscript:t}"
lab var lcmedianaug "Median voter{subscript:t-1}"
lab var dshec_se "{it:{&delta}}Shadow economy{subscript:t}"
lab var lshec_se "Shadow economy{subscript:t-1}"
lab var totgen "Welfare generosity{subscript:t}"
lab var dtotgen "{it:{&delta}}Welfare generosity{subscript:t}"
lab var ltotgen "Welfare generosity{subscript: t-1}"
lab var dreal "{it:{&delta}}Growth{subscript: t}"
lab var lreal "Growth{subscript: t-1}"
lab var dvdem_corr "{it:{&delta}}Corruption{subscript: t}"
lab var lvdem_corr "Corruption{subscript: t-1}"
lab var dopenc "{it:{&delta}}Trade openness{subscript: t}"
lab var lopenc "Trade openness{subscript: t-1}"
lab var dunemp "{it:{&delta}}Unemployment{subscript: t}"
lab var lunemp "Unemployment{subscript: t-1}"
lab var Dint_cmedianaugXshec_se "{it:{&delta}}Median voter position{subscript:t} x {it:{&delta}}Level of shadow economy{subscript:t}"
lab var Lint_cmedianaugXshec_se "Median voter position{subscript:t-1} x Level of shadow economy{subscript:t-1}"

set more off
xtpcse dtotgen ltotgen dshec_se dcmedianaug Dint_cmedianaugXshec_se lcmedianaug lshec_se Lint_cmedianaugXshec_se dreal lreal dvdem_corr lvdem_corr dwdi_trade lwdi_trade dempra lempra dictd_taxind lictd_taxind i.cc if sample_main == 1
grinter dcmedianaug, int(Dint_cmedianaugXshec_se) const(dshec_se) yline(0, lpattern(-...-) lc(gs7)) ciop(recast(rarea, fc(gs14))) nonote scheme(s2mono) title(ECM: Short-term) graphr(c(white)) saving(g2a.gph, replace)
	grinter lcmedianaug, int(Lint_cmedianaugXshec_se) const(lshec_se) yline(0, lpattern(-...-) lc(gs7)) ciop(recast(rarea, fc(gs14))) nonote scheme(s2mono) title(ECM: Long-term) graphr(c(white)) saving(g3a.gph, replace)
	graph combine g3a.gph g2a.gph, holes(2) graphr(c(white))
